package diablo3;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

public class Config {
	private static final Log LOG = LogFactory.getLog(Config.class);
	
	public static class Main {
		public static boolean sendIpMail;
		public static boolean systemPowerOff;
		public static boolean sendScreenShotMail;
		public static boolean autoRestartD3;
		public static boolean restartAMFCycle;
		public static boolean connectAMFCycle;
		public static boolean startD3AfterBoot;
	}
	
	public static class Processer{
		public static String TNTPath;
		public static String TNTHelperPath;
	}
	
	
	static Properties properties = new Properties();
	static {
		InputStream input = diablo3.Main.class.getClassLoader()
				.getResourceAsStream("config.properties");
		try {
			properties.load(input);
		} catch (IOException e) {
			LOG.error(e.getMessage(),e);
		} 
		
		Main.sendIpMail = Boolean.parseBoolean(properties.get("Main.sendIpMail").toString());
		Main.systemPowerOff = Boolean.parseBoolean(properties.get("Main.systemPowerOff").toString());
		Main.sendScreenShotMail = Boolean.parseBoolean(properties.get("Main.sendScreenShotMail").toString());
		Main.autoRestartD3 = Boolean.parseBoolean(properties.get("Main.autoRestartD3").toString());
		Main.restartAMFCycle = Boolean.parseBoolean(properties.get("Main.restartAMFCycle").toString());
		Main.connectAMFCycle = Boolean.parseBoolean(properties.get("Main.connectAMFCycle").toString());
		Main.startD3AfterBoot = Boolean.parseBoolean(properties.get("Main.startD3AfterBoot").toString());
		
		Processer.TNTPath = properties.get("Processer.TNTPath").toString();
		Processer.TNTHelperPath = properties.get("Processer.TNTHelperPath").toString();
	}
}
